{% extends 'base.html' %}
{% load static %}

      {% block body %}
        <div>
            <div class="container">
                <div style="margin-bottom: 10px;margin-top: -10px;">
                    <a style="border: 1px solid black;padding: 5px;border-radius: 3px;color: green;" href="/depart/add/"><span class="glyphicon glyphicon-plus-sign"></span>添加部门</a>
                </div>
                <div class="panel panel-default" style="background-color: rgb(241, 238, 233);">
                    <div class="panel-heading">
                        <span class="glyphicon glyphicon-th-list"></span>
                        部门管理</div>
                    <table class="table">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>部门编号</th>
                                <th>部门</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for depart in queryset %}
                            <tr>
                                <td>{{forloop.counter}}</td>
                                <td>{{depart.d_id}}</td>
                                <td>{{depart.title}}</td>
                                <td>
                                    <a style="border: 1px solid black;padding: 1px;border-radius: 3px;" href="/depart/edit/{{depart.id}}/"><span class="glyphicon glyphicon-edit"></span>编辑</a>
                                    <a style="border: 1px solid black;padding: 1px;border-radius: 3px;color: red;margin-left: 5px;" href="/depart/delete/?nid={{depart.id}}"><span class="glyphicon glyphicon-minus-sign"></span>删除</a>
                                </td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
      {% endblock body %}
